#!/bin/sh
host=106.186.126.60
dir_name=project_dir
host_dir=/data/vhosts

command='cd '$host_dir'; mkdir '$dir_name'; cd '$dir_name'; tar xzf ../'$dir_name'.tar.gz; cd ../; rm -rf '$dir_name'.tar.gz'

cd app
tar czf ../$dir_name.tar.gz *
cd ../
scp -P 18001 $dir_name.tar.gz root@$host:$host_dir
ssh -p 18001 -l root $host $command
rm -r $dir_name.tar.gz
